package com.example.yjhteam.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.yjhteam.entity.TeamDataDTO;
import com.example.yjhteam.entity.Teams;
import com.example.yjhteam.mapper.TeamsMapper;
import com.example.yjhteam.service.ITeamsService;
import com.mysql.jdbc.StringUtils;
import com.yc.yjh.biz.BizException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 队伍表 服务实现类
 * </p>
 *
 * @author ly
 * @since 2023-07-18
 */
@Service
public class TeamsServiceImpl extends ServiceImpl<TeamsMapper, Teams> implements ITeamsService {
    @Resource
    TeamsMapper teamsMapper;

    @Override
    public List<TeamDataDTO> selectDataByTeamId(String id,int page,int size) throws BizException {
        if (StringUtils.isNullOrEmpty(id)){
            throw new BizException("业务异常，请联系管理员");
        }
        int count =page*size;
        return  teamsMapper.selectMatchResultByTeamId(id,count,size);
    }

}
